<template>
	<view>
		<HeaderBar title="我的推广" :opacity="opacity" color="#fff" />
		<view class="bg"></view>
		<u-gap :height="34"></u-gap>
		<view class="content">
			<view class="content-title">推广产品</view>
			<view class="content-subTitle">出示二维码推广产品</view>
		</view>
		<view class="qrCode">
			<image :src="url" mode="" class="qrCode-img"></image>
			<view class="qrCode-title">您可以出示此二维码推广小程序
				参与推广有奖励哦～</view>
			<view class="qrCode-btn" @click="toDetail">推广记录</view>
		</view>
	</view>
</template>

<script>
	import HeaderBar from "@/components/header/header.vue"
	export default {
		components: {
			HeaderBar
		},
		data() {
			return {
				opacity: 0,
				url: ''
			};
		},
		onLoad() {
			this.url = uni.getStorageSync('userInfo').weixin_qr_code ?? ''
		},
		methods: {
			toDetail() {
				uni.navigateTo({
					url:'/pages/order-pay/order-pay'
				})
			}
		}
	}
</script>

<style lang="scss">
	.bg {
		width: 100%;
		height: 300rpx;
		position: absolute;
		top: 0;
		left: 0;
		z-index: -1;
		background: #0065FF;

	}
	.qrCode {
		width: 100vw;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		padding: 100rpx 0;
		.qrCode-img {
			width: 400rpx;
			height: 400rpx;
			margin-bottom: 90rpx;
		}
		.qrCode-title {
			 color: #000000;
			 text-align: center;
			 font-family: "PingFang SC";
			 font-size: 28rpx;
			 font-style: normal;
			 font-weight: 500;
			 margin-bottom: 116rpx;
		}
		.qrCode-btn {
			width: 364rpx;
			height: 90rpx;
			flex-shrink: 0;
			fill: #0065FF;
			display: flex;
			align-items: center;
			justify-content: center;
			color: #0065FF;
			 font-family: "PingFang SC";
			 font-size: 36rpx;
			 font-style: normal;
			 font-weight: 500;
			 background: #E6F0FF;
			 border-radius: 46rpx;
		}
	}
	.content {
		width: 100%;
		position: relative;
		background: white;
		box-sizing: border-box;
		padding: 0 40rpx;
		margin-bottom: 58rpx;

		.content-title {
			color: #112950;
			font-family: "PingFang SC";
			font-size: 48rpx;
			font-style: normal;
			font-weight: 400;
			margin-bottom: 4rpx;
		}

		.content-subTitle {
			color: #b2bac6;
			font-family: "PingFang SC";
			font-size: 30rpx;
			font-style: normal;
			font-weight: 400;
		}
	}

	.content::before {
		content: "";
		width: 100%;
		height: 45rpx;
		background: white;
		border-top-right-radius: 50rpx;
		position: absolute;
		top: -42rpx;
		left: 0;
	}
	
</style>